home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / net / bind-contrib.tar.gz / bind-contrib.tar / contrib / misc / cachebuild.shar / cachebuild.SH < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1996-10-25  |  913 b   |  44 lines

  1. #!/bin/sh
  2. #        ROOT CACHE PROGRAM
  3. #    By Paul Balyoz <pab@rainbow.cse.nau.edu>  03/15/91
  4. #
  5.  
  6. # Name of file to write the new root cache into
  7. OUT="CACHEFILE"
  8.  
  9. # Front part of the name of the awk script we need to run
  10. AWKSCR="CBAWKPATH"
  11.  
  12. # This must include the directory where "nslookup" lives
  13. PATH=/usr/ucb:/bin:/usr/bin:/usr/etc:/usr/local/bin:/usr/com/bin
  14. export PATH
  15.  
  16. # --------------------------------------------------------------------------
  17.  
  18. rm -f $OUT.older
  19. if test -f $OUT.old; then
  20.     mv $OUT.old $OUT.older
  21. fi
  22. if test -f $OUT; then
  23.     mv $OUT $OUT.old
  24. fi
  25.  
  26. echo ";" > $OUT
  27. echo "; root.cache built by $USER@`hostname` on `date`" >> $OUT
  28. echo "; Automatically built by cachebuild, any changes you make may go away." >> $OUT
  29. echo ";" >> $OUT
  30. echo "" >> $OUT
  31.  
  32. nslookup << EOF | awk -f $AWKSCR >> $OUT
  33. set type=NS
  34. root
  35. .
  36. EOF
  37.  
  38. err=$?
  39. if test $err -ne 0; then
  40.     echo "Call to nslookup failed."
  41.     rm -f $OUT
  42. fi
  43. exit $err
  44.